<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" th:href="@{/css/sapar.css}" />
    <link rel="stylesheet" th:href="@{/css/index_inner.css}" />
    
    <title>系统</title>
    <style type="text/css">
        .search-box .kv-item {
            float: left;
        }
        .dialog-content .buttons {
            float:left;
            margin-top:0px;
            margin-left:30px;
            padding-left:10px;
        }
    </style>
</head>

<body>
    <div id="container">
        <div id="bd">
            <div class="wrap clearfix">
                <div class="sidebar">
                    <h2 class="sidebar-header"><p>功能导航</p></h2>
                    <ul class="nav" th:utext="${wvp.BuildModuleLeftMenu(Model)}">
                            
                    </ul>
                </div>
                <div class="content">
                    <iframe src="" id="iframe" width="100%" height="100%" frameborder="0"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div class="queryFuncDialog" style="display:none">
        <div class="dialog-content">
            <form class="saper-form " action="#" method="post">
                <div class="search-box clearfix">
                    <div class="kv-item clearfix">
                        @Html.BuildLabel("关键字(空格分隔)：",a=>a.AutoWidth())
                        <div class="kv-item-content">
                            @Html.BuildTextBox("funcName")
                        </div>
                    </div>
                    <div class="buttons">
                        <a href="javascript:;" class="sapar-btn sapar-btn-recom ok">确定</a>
                    </div>
                </div>
            </form>
            <div class="wrap clearfix">
                <iframe src="" id="queryFunc-iframe" width="100%" height="450" frameborder="0"></iframe>
            </div>
        </div>
    </div>

    <script type="text/javascript" th:src="@{/js/jq/jquery-1.8.0.min.js}" ></script>
    <script type="text/javascript" th:src="@{/js/sapar.js}" ></script>
    <script type="text/javascript" th:src="@{/js/pfUtil.js}" ></script>
    <script type="text/javascript" th:src="@{/js/index_inner.js}" ></script>
    
    <script type="text/javascript">
    $(document).ready(function () {

        var queryFuncDialog = $('.queryFuncDialog')
            .Dialog({
                title: '查找功能',
                autoOpen: false,
                width:800,
                height:500
            });

        $('.queryFuncDialog').on('goToFunc', function (elem, funcSrc) {
            $("#iframe").attr("src", funcSrc);
        });

        $('#bd h2.sidebar-header').click(function () {
            queryFuncDialog.Dialog('open');
        });

        var queryFuncForm = $('.queryFuncDialog form.saper-form');
        var queryFuncOKBtn = queryFuncForm.find('a.ok');
        queryFuncOKBtn.click(function () {
            queryFuncForm.submit();
        });
        queryFuncForm.submit(function (e) {
            var param = queryFuncForm.serialize();
            $('#queryFunc-iframe').attr('src', "/YJQuery/QueryFunc/QueryFuncTree?" + param);
            return false;
        });
    });
    </script>
</body>
</html>
